package com.topisv.tms.rest.qimen.qmservice;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.qimen.QmResendInfo;
import com.topisv.tms.repository.qimen.QmResendInfoDao;

/**
 * 重发机制  create by gaohuan 2015-05-09
 * */
@Component
@Lazy(false)
@Transactional(readOnly =  true)
public class QmResendInfoService   {
	@Autowired
	private QmResendInfoDao qmResendInfoDao;
	
	
	public List<QmResendInfo> findBySendResultAndResendCount(){
		return qmResendInfoDao.findBySendResultAndResendCount();
	}
	
	/*
	 * 删除已重发成功的历史数据
	 * */
	public void deleteOverTimeData(){
		qmResendInfoDao.deleteOverTimeData();
	}

	@Transactional(readOnly =  false)
    public void save(QmResendInfo qmResendInfo){
    	qmResendInfoDao.save(qmResendInfo);
    }
	
	@Transactional(readOnly =  false)
    public void save(List<QmResendInfo> qmResendInfoList){
    	qmResendInfoDao.save(qmResendInfoList);
    }
    
}
